UBlox M10 Support
[openXsensor.git] / oXs_Configurator / Python 37 Sources / oxsConfig.py
blob6c296dfee0aa2a3c83ccf13e39b62fc2e4f28477
1 from tkinter import StringVar , Tk , W ,E , S , BOTH, HIDDEN, DoubleVar , Spinbox , IntVar , filedialog
2 from tkinter import ttk
3 from tkinter import messagebox
5 #from impExp import *
6 import configparser
8 #from oxsConfigurator import protocolChanged
9 #from oxsPpm import ppmTypeChanged
11 configUploadFileName = None
13 config = configparser.ConfigParser()
14 config.add_section("Main")
15 config.add_section("Ppm")
16 config.add_section("Imu")
17 config.add_section("Magnet")
18 config.add_section("Vario")
19 config.add_section("Airspeed")
20 config.add_section("Voltage")
21 config.add_section("Current")
22 config.add_section("Ads")
23 config.add_section("Flow")
24 config.add_section("Rpm")
25 config.add_section("Gps")
26 config.add_section("Memory")
27 config.add_section("AddFields")
28 config.add_section("Frsky")
29 config.add_section("Multiplex")
30 config.add_section("Hott")
31 config.add_section("Jeti")
33 def generateOxsConfig():
34 f=open("oXs_config_basic.h" , 'w')
35 fa=open("oXs_config_advanced.h" , 'w')
36 f.write("#ifndef OXS_CONFIG_BASIC_h\n")
37 f.write("#define OXS_CONFIG_BASIC_h\n")
38 f.write("\n")
39 fa.write("#ifndef OXS_CONFIG_ADVANCED_h\n")
40 fa.write("#define OXS_CONFIG_ADVANCED_h\n")
41 fa.write("\n")
42 fa.write(f"#define PIN_SERIALTX {pinToRxVar.get()}\n")
43 f.write(f"\n#define PROTOCOL {protocolVar.get()}\n\n")
44 if (protocolVar.get() == 'FRSKY_SPORT' or
45 protocolVar.get() == 'FRSKY_SPORT_HUB' or
46 protocolVar.get() == 'FRSKY_HUB') :
47 if frskyVfasVar.get() != 'Not sent':
48 f.write(f"#define VFAS_SOURCE {frskyVfasVar.get()}\n")
49 if frskyFuelVar.get() != 'Not sent':
50 f.write(f"#define FUEL_SOURCE {frskyFuelVar.get()}\n")
51 if frskyA3Var.get() != 'Not sent':
52 f.write(f"#define A3_SOURCE {frskyA3Var.get()}\n")
53 if frskyA4Var.get() != 'Not sent':
54 f.write(f"#define A4_SOURCE {frskyA4Var.get()}\n")
55 if frskyAccxVar.get() != 'Not sent':
56 f.write(f"#define ACCX_SOURCE {frskyAccxVar.get()}\n")
57 if frskyAccyVar.get() != 'Not sent':
58 f.write(f"#define ACCY_SOURCE {frskyAccyVar.get()}\n")
59 if frskyAcczVar.get() != 'Not sent':
60 f.write(f"#define ACCZ_SOURCE {frskyAcczVar.get()}\n")
61 if frskyT1Var.get() != 'Not sent':
62 f.write(f"#define T1_SOURCE {frskyT1Var.get()}\n")
63 if frskyT2Var.get() != 'Not sent':
64 f.write(f"#define T2_SOURCE {frskyT2Var.get()}\n")
66 if protocolVar.get() == 'FRSKY_SPORT' or protocolVar.get() == 'FRSKY_SPORT_HUB':
67 fa.write("\n#define DATA_ID_VARIO 0x00\n")
68 fa.write("#define DATA_ID_FLVSS 0xA1\n")
69 fa.write("#define DATA_ID_FAS 0x22\n")
70 fa.write("#define DATA_ID_GPS 0x83\n")
71 fa.write("#define DATA_ID_RPM 0xE4\n")
72 fa.write("#define DATA_ID_ACC 0x67\n")
73 fa.write("#define DATA_ID_TX 0x0D\n")
75 if protocolVar.get() == 'JETI':
76 if jetiVoltageSourceVar.get() != 'Not sent':
77 f.write(f"#define VOLTAGE_SOURCE {jetiVoltageSourceVar.get()}\n")
78 if jetiTemperatureSourceVar.get() != 'Not sent':
79 f.write(f"#define TEMPERATURE_SOURCE {jetiTemperatureSourceVar.get()}\n")
81 if protocolVar.get() == 'HOTT':
82 if hottCellUndervoltageVar.get() > 0:
83 f.write(f"#define CELL_UNDERVOLTAGE_WARNING {hottCellUndervoltageVar.get()}\n")
84 if hottBattery1SourceVar.get() != 'Not sent':
85 f.write(f"#define BATTERY_1_SOURCE {hottBattery1SourceVar.get()}\n")
86 if hottBattery2SourceVar.get() != 'Not sent':
87 f.write(f"#define BATTERY_2_SOURCE {hottBattery2SourceVar.get()}\n")
88 if hottMainBatterySourceVar.get() != 'Not sent':
89 f.write(f"#define MAIN_BATTERY_SOURCE {hottMainBatterySourceVar.get()}\n")
90 if hottT1SourceVar.get() != 'Not sent':
91 f.write(f"#define TEMPERATURE_1_SOURCE {hottT1SourceVar.get()}\n")
92 if hottT2SourceVar.get() != 'Not sent':
93 f.write(f"#define TEMPERATURE_2_SOURCE {hottT2SourceVar.get()}\n")
95 if protocolVar.get() == 'MULTIPLEX':
96 if (multiplexLine1Var.get() != 'Not sent') or (multiplexLine2Var.get() != 'Not sent') or (multiplexLine3Var.get() != 'Not sent') or \
97 (multiplexLine4Var.get() != 'Not sent') or (multiplexLine5Var.get() != 'Not sent') or (multiplexLine6Var.get() != 'Not sent'):
98 f.write("#define SETUP_MULTIPLEX_DATA_TO_SEND ")
99 firstLine = True
100 if multiplexLine1Var.get() != 'Not sent':
101 firstLine = False
102 f.write("\\")
103 f.write(f"\n 1, {multiplexLine1Var.get()} , 1 , 1 , 0 , -16384 , 16383 ")
104 if multiplexLine2Var.get() != 'Not sent':
105 if firstLine == False:
106 f.write(" , ")
107 else:
108 firstLine = False
109 f.write("\\")
110 f.write(f"\n 2, {multiplexLine2Var.get()} , 1 , 1 , 0 , -16384 , 16383 ")
111 if multiplexLine3Var.get() != 'Not sent':
112 if firstLine == False:
113 f.write(" , ")
114 else:
115 firstLine = False
116 f.write("\\")
117 f.write(f"\n 3, {multiplexLine3Var.get()} , 1 , 1 , 0 , -16384 , 16383 ")
118 if multiplexLine4Var.get() != 'Not sent':
119 if firstLine == False:
120 f.write(" , ")
121 else:
122 firstLine = False
123 f.write("\\")
124 f.write(f"\n 4, {multiplexLine4Var.get()} , 1 , 1 , 0 , -16384 , 16383 ")
125 if multiplexLine5Var.get() != 'Not sent':
126 if firstLine == False:
127 f.write(" , ")
128 else:
129 firstLine = False
130 f.write("\\")
131 f.write(f"\n 5, {multiplexLine5Var.get()} , 1 , 1 , 0 , -16384 , 16383 ")
132 if multiplexLine6Var.get() != 'Not sent':
133 if firstLine == False:
134 f.write(" , ")
135 else:
136 firstLine = False
137 f.write("\\")
138 f.write(f"\n 6, {multiplexLine6Var.get()} , 1 , 1 , 0 , -16384 , 16383 ")
139 if multiplexLine7Var.get() != 'Not sent':
140 if firstLine == False:
141 f.write(" , ")
142 else:
143 firstLine = False
144 f.write("\\")
145 f.write(f"\n 7, {multiplexLine7Var.get()} , 1 , 1 , 0 , -16384 , 16383 ")
146 if multiplexLine8Var.get() != 'Not sent':
147 if firstLine == False:
148 f.write(" , ")
149 else:
150 firstLine = False
151 f.write("\\")
152 f.write(f"\n 8, {multiplexLine8Var.get()} , 1 , 1 , 0 , -16384 , 16383 ")
153 if multiplexLine9Var.get() != 'Not sent':
154 if firstLine == False:
155 f.write(" , ")
156 else:
157 firstLine = False
158 f.write("\\")
159 f.write(f"\n 9, {multiplexLine9Var.get()} , 1 , 1 , 0 , -16384 , 16383 ")
160 f.write("\n")
161 else:
162 messagebox.showwarning("Warning","Generated files will be unvalid:\n for Multiplex protocol, you must specify the field(s) to be sent")
164 if addFieldsExist.get() == "On":
165 if fillTest1VarioTemperatureVar.get() == "On":
166 fa.write("\n#define FILL_TEST_1_WITH_VARIO_TEMP\n")
167 if fillTest2VarioTemperatureVar.get() == "On":
168 fa.write("\n#define FILL_TEST_2_WITH_VARIO_TEMP\n")
169 if fillTest3VarioTemperatureVar.get() == "On":
170 fa.write("\n#define FILL_TEST_3_WITH_VARIO_TEMP\n")
171 if fillTest3ExpectedAltitudeVar.get() == "On":
172 fa.write("\n#define FILL_TEST_3_WITH_EXPECTED_ALT\n")
173 fa.write(f"\n#define EXPECTED_ALT_AT_SEC {str(expAltTimeVar.get())}\n")
174 if fillTest123LinearAccVar.get() == "On":
175 fa.write("\n#define FILL_TEST_1_2_3_WITH_LINEAR_ACC\n")
176 if fillTest12VspeedAltVar.get() == "On":
177 fa.write("\n#define FILL_TEST_1_2_WITH_VSPEED_AND_ALT_FROM_SECOND_VARIO\n")
178 if fillTest1DteVar.get() == "On":
179 fa.write("\n#define FILL_TEST_1_WITH_DTE\n")
180 if fillTest2PpmAirspeedCompVar.get() == "On":
181 fa.write("\n#define FILL_TEST_2_WITH_PPM_AIRSPEED_COMPENSATION\n")
182 if fillTest1YawRateVar.get() == "On":
183 fa.write("\n#define FILL_TEST_1_WITH_YAWRATE\n")
184 if fillTest1HeadingVar.get() == "On":
185 fa.write("\n#define FILL_TEST1_WITH_HEADING_FROM_MAGNETOMETER\n")
186 if fillTest123FlowVar.get() == "On":
187 fa.write("\n#define FILL_TEST_1_2_3_WITH_FLOW_SENSOR_CONSUMPTION\n")
188 if fillTest1GpsNbrSatVar.get() == "On":
189 fa.write("\n#define FILL_TEST1_WITH_GPS_NUMBER_OF_SAT\n")
190 if fillTest2GpsHdopVar.get() == "On":
191 fa.write("\n#define FILL_TEST2_WITH_GPS_HDOP\n")
193 if ppmExist.get() == "On":
194 if ppmTypeVar.get() == 'Rx chanel':
195 fa.write(f"\n#define PIN_PPM {str(ppmPinVar.get())}\n")
196 fa.write(f"#define PPM_MIN_100 {str(ppmForMin100Var.get())}\n")
197 fa.write(f"#define PPM_PLUS_100 {str(ppmForPlus100Var.get())}\n")
198 else:
199 fa.write("\n#define PPM_VIA_SPORT \n")
201 if persistentExist.get() == "On":
202 f.write("\n#define SAVE_TO_EEPROM YES\n")
203 f.write(f"\n#define PIN_PUSHBUTTON {str(pushButtPinVar.get())}\n")
204 else:
205 f.write("\n#define SAVE_TO_EEPROM NO\n")
207 if varioExist.get() == "On":
208 f.write(f"#define FIRST_BARO_SENSOR_USE {varioTypeVar.get()}\n")
209 if varioTypeVar.get() == 'BMP280':
210 fa.write("#define BMP280_ADR 0x76\n")
211 f.write(f"#define VSPEED_SOURCE {varioSourceVar.get()}\n")
212 if secondBaroExist.get() == 'On':
213 fa.write("\n#define SECOND_BARO_SENSOR_USE MS5611\n")
214 else:
215 fa.write("\n#define SECOND_BARO_SENSOR_USE NO_BARO\n")
216 fa.write("\n#define SENSITIVITY_MIN 80\n")
217 fa.write("#define SENSITIVITY_MAX 300\n")
218 fa.write("#define SENSITIVITY_MIN_AT 100\n")
219 fa.write("#define SENSITIVITY_MAX_AT 1000\n")
220 if ppmExist.get() == "On":
221 fa.write("\n#define SENSITIVITY_MIN_AT_PPM 10\n")
222 fa.write("#define SENSITIVITY_MAX_AT_PPM 40\n")
223 fa.write("#define SENSITIVITY_PPM_MIN 20\n")
224 fa.write("#define SENSITIVITY_PPM_MAX 100\n")
225 fa.write(f"\n#define VARIOHYSTERESIS {str(varioHysteresisVar.get())}\n")
226 if analogVarioExist.get() == "On":
227 fa.write(f"\n#define PIN_ANALOG_VSPEED {varioAnalogPinVar.get()}\n")
228 fa.write(f"#define ANALOG_VSPEED_MIN {varioAnalogMinVar.get()}\n")
229 fa.write(f"#define ANALOG_VSPEED_MAX {varioAnalogMaxVar.get()}\n")
230 else:
231 f.write("#define FIRST_BARO_SENSOR_USE NO_BARO\n")
233 if airspeedExist.get() == "On":
234 f.write(f"#define AIRSPEED_SENSOR_USE {airspeedTypeVar.get()}\n")
235 if airspeedAtSea15CVar == "On":
236 fa.write("\n#define AIRSPEED_AT_SEA_LEVEL_AND_15C\n")
237 if airspeedInKmhVar == "On":
238 fa.write("\n#define AIRSPEED_IN_KMH\n")
239 fa.write(f"\n#define AIRSPEED_RESET_AT_PPM {airspeedResetAtPpmVar.get()}\n")
240 fa.write(f"\n#define COMPENSATION_MIN_AT_PPM {airspeedCompMinAtPpmVar.get()}\n")
241 fa.write(f"\n#define COMPENSATION_MAX_AT_PPM {airspeedCompMaxAtPpmVar.get()}\n")
242 fa.write(f"\n#define COMPENSATION_PPM_MIN {airspeedCompMinVar.get()}\n")
243 fa.write(f"\n#define COMPENSATION_PPM_MAX {airspeedCompMaxVar.get()}\n")
244 else:
245 f.write("\n#define AIRSPEED_SENSOR_USE NO_AIRSPEED\n")
247 if voltageExist.get() == "On":
248 f.write("\n#define ARDUINO_MEASURES_VOLTAGES YES\n")
249 f.write(f"#define NUMBEROFCELLS {voltNumberOfCellsVar.get()}\n")
250 if voltReferenceVar.get() == "Internal":
251 fa.write("\n#define USE_INTERNAL_REFERENCE\n")
252 elif voltReferenceVar.get() == "External":
253 fa.write("\n#define USE_EXTERNAL_REFERENCE\n")
254 fa.write(f"\n#define REFERENCE_VOLTAGE {str(voltRefValueVar.get())}\n")
255 else:
256 fa.write(f"\n#define REFERENCE_VOLTAGE {str(voltRefValueVar.get())}\n")
257 fa.write(f"\n#define PIN_VOLTAGE ")
258 if volt1Exist.get() == 'On':
259 fa.write(f" {volt1PinVar.get()} , ")
260 else:
261 fa.write("8 , ")
262 if volt2Exist.get() == 'On':
263 fa.write(f" {volt2PinVar.get()} , ")
264 else:
265 fa.write("8 , ")
266 if volt3Exist.get() == 'On':
267 fa.write(f" {volt3PinVar.get()} , ")
268 else:
269 fa.write("8 , ")
270 if volt4Exist.get() == 'On':
271 fa.write(f" {volt4PinVar.get()} , ")
272 else:
273 fa.write("8 , ")
274 if volt5Exist.get() == 'On':
275 fa.write(f" {volt5PinVar.get()} , ")
276 else:
277 fa.write("8 , ")
278 if volt6Exist.get() == 'On':
279 fa.write(f" {volt6PinVar.get()} \n")
280 else:
281 fa.write("8\n")
282 fa.write((f"#define RESISTOR_TO_GROUND {volt1RgVar.get()} , " +
283 f"{volt2RgVar.get()} , {volt3RgVar.get()} , {volt4RgVar.get()} , " +
284 f"{volt5RgVar.get()} , {volt6RgVar.get()}\n"))
285 fa.write((f"#define RESISTOR_TO_VOLTAGE {volt1RvVar.get()} , " +
286 f"{volt2RvVar.get()} , {volt3RvVar.get()} , {volt4RvVar.get()} , " +
287 f"{volt5RvVar.get()} , {volt6RvVar.get()}\n"))
288 fa.write((f"#define OFFSET_VOLTAGE {volt1OffsetVar.get()} , " +
289 f"{volt2OffsetVar.get()} , {volt3OffsetVar.get()} , {volt4OffsetVar.get()} , " +
290 f"{volt5OffsetVar.get()} , {volt6OffsetVar.get()}\n"))
291 fa.write((f"#define SCALE_VOLTAGE {volt1ScaleVar.get()} , " +
292 f"{volt2ScaleVar.get()} , {volt3ScaleVar.get()} , {volt4ScaleVar.get()} , " +
293 f"{volt5ScaleVar.get()} , {volt6ScaleVar.get()}\n"))
294 else:
295 f.write("\n#define ARDUINO_MEASURES_VOLTAGES NO\n")
297 if currentExist.get() == "On":
298 f.write("\n#define ARDUINO_MEASURES_A_CURRENT YES\n")
299 fa.write(f"\n#define PIN_CURRENTSENSOR {currentPinVar.get()}\n")
300 fa.write(f"#define MVOLT_AT_ZERO_AMP {str(currentMvoltAt0Var.get())}\n")
301 fa.write(f"#define MVOLT_PER_AMP {str(currentMvoltPerAmpVar.get())}\n")
302 fa.write(f"#define RESISTOR_TO_GROUND_FOR_CURRENT {str(currentRgVar.get())}\n")
303 fa.write(f"#define RESISTOR_TO_CURRENT_SENSOR {str(currentRcVar.get())}\n")
304 else:
305 f.write("\n#define ARDUINO_MEASURES_A_CURRENT NO\n")
307 if adcExist.get() == "On":
308 if (Adc0TypeVar.get() != "ADS_OFF") or (Adc1TypeVar.get() != "ADS_OFF") or (Adc2TypeVar.get() != "ADS_OFF") or (Adc3TypeVar.get() != "ADS_OFF"):
309 f.write("\n#define AN_ADS1115_IS_CONNECTED YES\n")
310 fa.write(f"\n#define ADS_MEASURE {Adc0TypeVar.get()}, {Adc1TypeVar.get()}, {Adc2TypeVar.get()}, {Adc3TypeVar.get()}\n")
311 fa.write(f"#define ADS_FULL_SCALE_VOLT {Adc0FsVar.get()}, {Adc1FsVar.get()}, {Adc2FsVar.get()}, {Adc3FsVar.get()}\n")
312 fa.write(f"#define ADS_OFFSET {str(Adc0OffVar.get())}, {str(Adc1OffVar.get())}, {str(Adc2OffVar.get())}, {str(Adc3OffVar.get())}\n")
313 fa.write(f"#define ADS_SCALE {str(Adc0ScVar.get())}, {str(Adc1ScVar.get())}, {str(Adc2ScVar.get())}, {str(Adc3ScVar.get())}\n")
314 fa.write(f"#define ADS_RATE {Adc0CrVar.get()}, {Adc1CrVar.get()}, {Adc2CrVar.get()}, {Adc3CrVar.get()}\n")
315 if Adc0AvgVar.get()<1:
316 Adc0AvgVar.set(1)
317 if Adc1AvgVar.get()<1:
318 Adc1AvgVar.set(1)
319 if Adc2AvgVar.get()<1:
320 Adc2AvgVar.set(1)
321 if Adc3AvgVar.get()<1:
322 Adc3AvgVar.set(1)
323 if Adc0AvgVar.get()>254:
324 Adc0AvgVar.set(254)
325 if Adc1AvgVar.get()>254:
326 Adc1AvgVar.set(254)
327 if Adc2AvgVar.get()>254:
328 Adc2AvgVar.set(254)
329 if Adc3AvgVar.get()>254:
330 Adc3AvgVar.set(254)
331 fa.write(f"#define ADS_AVERAGING_ON {str(Adc0AvgVar.get())}, {str(Adc1AvgVar.get())}, {str(Adc2AvgVar.get())}, {str(Adc3AvgVar.get())}\n")
332 if AdcCurrVar.get() != "NO":
333 fa.write(f"#define ADS_CURRENT_BASED_ON {AdcCurrVar.get()}\n")
334 if AdcSpVar.get() != "NO":
335 fa.write(f"#define ADS_AIRSPEED_BASED_ON {AdcSpVar.get()}\n")
336 else:
337 f.write("\n#define AN_ADS1115_IS_CONNECTED NO\n")
338 else:
339 f.write("\n#define AN_ADS1115_IS_CONNECTED NO\n")
341 if rpmExist.get() == "On":
342 f.write("\n#define CALCULATE_RPM YES\n")
343 fa.write(f"\n#define PULSES_PER_ROTATION {pulsesPerRotationVar.get()}\n")
344 else:
345 f.write("\n#define CALCULATE_RPM NO\n")
347 if gpsExist.get() == "On":
348 f.write("\n#define A_GPS_IS_CONNECTED YES\n")
349 if gpsTimeExist.get() == 'On':
350 fa.write("\n#define GPS_TRANSMIT_TIME\n")
351 if gpsM10.get() == 'On':
352 fa.write("\n#define GPS_M10\n")
353 if gps3dExist.get() == 'On':
354 fa.write("\n#define GPS_SPEED_3D\n")
355 fa.write(f"#define GPS_REFRESH_RATE {gpsRateVar.get()}\n")
356 else:
357 fa.write(f"\n#define GPS_REFRESH_RATE {gpsRateVar.get()}\n")
358 else:
359 f.write("\n#define A_GPS_IS_CONNECTED NO\n")
361 if imuExist.get() == "On":
362 f.write("\n#define A_MPU6050_IS_CONNECTED YES\n")
363 fa.write(f"\n#define PIN_INT_6050 {str(imuPinVar.get())}\n")
364 if imuDisplayOffset.get() == "On":
365 fa.write("\n#define DISPLAY_ACC_OFFSET\n")
366 fa.write("#define ACC_OFFSET_X 0\n")
367 fa.write("#define ACC_OFFSET_Y 0\n")
368 fa.write("#define ACC_OFFSET_Z 0\n")
369 else:
371 fa.write(f"#define ACC_OFFSET_X {str(imuOffsetXVar.get())}\n")
372 fa.write(f"#define ACC_OFFSET_Y {str(imuOffsetYVar.get())}\n")
373 fa.write(f"#define ACC_OFFSET_Z {str(imuOffsetZVar.get())}\n")
374 else:
375 f.write("\n#define A_MPU6050_IS_CONNECTED NO\n")
377 if magnetExist.get() == "On":
378 if GeneratemagCalData.get() == "On":
379 fa.write("\n#define GENERATE_MAG_CALIBRATION_DATA\n")
380 fa.write("#define XMAG_OFFSET 0\n")
381 fa.write("#define YMAG_OFFSET 0\n")
382 fa.write("#define ZMAG_OFFSET 0\n")
383 fa.write("#define XXMAG_CORRECTION 1\n")
384 fa.write("#define XYMAG_CORRECTION 0\n")
385 fa.write("#define XZMAG_CORRECTION 0\n")
386 fa.write("#define YXMAG_CORRECTION 0\n")
387 fa.write("#define YYMAG_CORRECTION 1\n")
388 fa.write("#define YZMAG_CORRECTION 0\n")
389 fa.write("#define ZXMAG_CORRECTION 0\n")
390 fa.write("#define ZYMAG_CORRECTION 0\n")
391 fa.write("#define ZZMAG_CORRECTION 1\n")
392 else:
393 fa.write(f"#define XMAG_OFFSET {str(xMagOffsetVar.get())}\n")
394 fa.write(f"#define YMAG_OFFSET {str(yMagOffsetVar.get())}\n")
395 fa.write(f"#define ZMAG_OFFSET {str(zMagOffsetVar.get())}\n")
396 fa.write(f"#define XXMAG_CORRECTION {str(xxMagCorrectionVar.get())}\n")
397 fa.write(f"#define XYMAG_CORRECTION {str(xyMagCorrectionVar.get())}\n")
398 fa.write(f"#define XZMAG_CORRECTION {str(xzMagCorrectionVar.get())}\n")
399 fa.write(f"#define YXMAG_CORRECTION {str(yxMagCorrectionVar.get())}\n")
400 fa.write(f"#define YYMAG_CORRECTION {str(yyMagCorrectionVar.get())}\n")
401 fa.write(f"#define YZMAG_CORRECTION {str(yzMagCorrectionVar.get())}\n")
402 fa.write(f"#define ZXMAG_CORRECTION {str(zxMagCorrectionVar.get())}\n")
403 fa.write(f"#define ZYMAG_CORRECTION {str(zyMagCorrectionVar.get())}\n")
404 fa.write(f"#define ZZMAG_CORRECTION {str(zzMagCorrectionVar.get())}\n")
405 f.write("\n#define CALCULATE_YAW_WITH_HMC5883 YES\n")
407 else:
408 f.write("\n#define CALCULATE_YAW_WITH_HMC5883 NO\n")
410 if flowExist.get() == "On":
411 f.write("\n#define A_FLOW_SENSOR_IS_CONNECTED YES\n")
412 fa.write(f"#define PULSES_PER_ML {str(flowPulsesmlVar.get())}\n")
413 fa.write(f"#define TANK_CAPACITY {str(flowTankCapVar.get())}\n")
414 fa.write(f"#define INIT_FLOW_PARAM {str(flowL1ValueVar.get())} , {str(flowL2ValueVar.get())} , {str(flowL3ValueVar.get())} , {str(flowL4ValueVar.get())} , {str(flowL1CorrVar.get())} , {str(flowL2CorrVar.get())} , {str(flowL3CorrVar.get())} , {str(flowL4CorrVar.get())}\n")
415 fa.write(f"##define FLOW_SENSOR_RESET_AT_PPM {str(flowPPMResetVar.get())}\n")
416 else:
417 f.write("\n#define A_FLOW_SENSOR_IS_CONNECTED NO\n")
419 if sequenceExist.get() == 'On':
420 if SeqOut1Var.get()=='1' or SeqOut2Var.get()=='1' or SeqOut3Var.get()=='1' or SeqOut4Var.get()=='1' or SeqOut5Var.get()=='1' or SeqOut6Var.get()=='1':
421 fa.write(f"#define SEQUENCE_OUTPUTS 0b{SeqOut6Var.get()}{SeqOut5Var.get()}{SeqOut4Var.get()}{SeqOut3Var.get()}{SeqOut2Var.get()}{SeqOut1Var.get()}\n")
422 fa.write(f"#define SEQUENCE_UNIT {str(SeqUnitVar.get())}\n")
423 if SeqTVar[0].get()!='0' and SeqTVar[0].get()!='':
424 fa.write("#define SEQUENCE_m100 ")
425 for y in range (0,25):
426 if SeqTVar[y*4].get()=='':
427 break
428 if y!=0:
429 fa.write(",")
430 fa.write(f"{SeqTVar[y*4].get()}, 0b{str(SeqB5Var[y*4].get())}{str(SeqB4Var[y*4].get())}{str(SeqB3Var[y*4].get())}{str(SeqB2Var[y*4].get())}{str(SeqB1Var[y*4].get())}{str(SeqB0Var[y*4].get())}")
431 fa.write("\n")
432 if SeqTVar[1].get()!='0' and SeqTVar[1].get()!='':
433 fa.write("#define SEQUENCE_0 ")
434 for y in range (0,25):
435 if SeqTVar[y*4+1].get()=='':
436 break
437 if y!=0:
438 fa.write(",")
439 fa.write(f"{SeqTVar[y*4+1].get()}, 0b{str(SeqB5Var[y*4+1].get())}{str(SeqB4Var[y*4+1].get())}{str(SeqB3Var[y*4+1].get())}{str(SeqB2Var[y*4+1].get())}{str(SeqB1Var[y*4+1].get())}{str(SeqB0Var[y*4+1].get())}")
440 fa.write("\n")
441 if SeqTVar[2].get()!='0' and SeqTVar[2].get()!='':
442 fa.write("#define SEQUENCE_100 ")
443 for y in range (0,25):
444 if SeqTVar[y*4+2].get()=='':
445 break
446 if y!=0:
447 fa.write(",")
448 fa.write(f"{SeqTVar[y*4+2].get()}, 0b{str(SeqB5Var[y*4+2].get())}{str(SeqB4Var[y*4+2].get())}{str(SeqB3Var[y*4+2].get())}{str(SeqB2Var[y*4+2].get())}{str(SeqB1Var[y*4+2].get())}{str(SeqB0Var[y*4+2].get())}")
449 fa.write("\n")
450 if voltageExist.get() == "On":
451 if SeqTVar[3].get()!='0' and SeqTVar[3].get()!='' and (SeqMinVoltVar.get()!=0 or SeqMinCellVar.get()!=0):
452 fa.write("#define SEQUENCE_LOW ")
453 for y in range (0,25):
454 if SeqTVar[y*4+3].get()=='':
455 break
456 if y!=0:
457 fa.write(",")
458 fa.write(f"{SeqTVar[y*4+3].get()}, 0b{str(SeqB5Var[y*4+3].get())}{str(SeqB4Var[y*4+3].get())}{str(SeqB3Var[y*4+3].get())}{str(SeqB2Var[y*4+3].get())}{str(SeqB1Var[y*4+3].get())}{str(SeqB0Var[y*4+3].get())}")
459 fa.write("\n")
460 if (SeqMinVoltVar.get()!=0):
461 fa.write(f"#define SEQUENCE_MIN_VOLT_1 {str(SeqMinVoltVar.get())}")
462 messagebox.showinfo("oXs configurator", "Be carefull you may need to modify oXs_config_advanced.h to set the voltage source for sequence")
463 if (SeqMinCellVar.get()!=0):
464 fa.write(f"#define SEQUENCE_MIN_CELL {str(SeqMinCellVar.get())}")
465 if locatorExist.get() == "On":
466 f.write("\n#define A_LOCATOR_IS_CONNECTED YES\n")
467 else:
468 f.write("\n#define A_LOCATOR_IS_CONNECTED NO\n")
472 f.write("\n#endif\n")
473 fa.write("\n#endif\n")
474 f.close()
475 fa.close()
476 messagebox.showinfo("oXs configurator", "Config files advanced and basic have been created")
478 def uploadConfig():
479 from oxsVoltage import voltReferenceChanged
480 print("Read config")
481 #global configUploadFileName
482 #configUploadFileName = filedialog.askopenfilename(initialdir="C:/Data/",
483 configUploadFileName = filedialog.askopenfilename(\
484 filetypes =(("Ini files", "*.ini"),("All files","*.*")),
485 title = "Choose a file."
487 #config.read('config.ini')
488 config.read(configUploadFileName)
489 ppmExist.set(value= config.get('Main', 'ppmExist'))
490 ppmChanged()
491 varioExist.set(value= config.get('Main', 'varioExist'))
492 varioChanged()
493 voltageExist.set(value = config.get("Main", "voltageExist"))
494 voltageChanged()
495 currentExist.set(value = config.get("Main", "currentExist"))
496 currentChanged()
497 gpsExist.set(value = config.get("Main", "gpsExist"))
498 gpsChanged()
499 airspeedExist.set(value= config.get("Main", "airspeedExist"))
500 airspeedChanged()
501 rpmExist.set(value= config.get("Main", "rpmExist"))
502 rpmChanged()
503 imuExist.set(value= config.get("Main", "imuExist"))
504 imuChanged()
505 magnetExist.set(value= config.get("Main", "magnetExist"))
506 magnetChanged()
507 flowExist.set(value= config.get("Main", "flowExist"))
508 flowChanged()
509 adcExist.set(value= config.get("Main", "adcExist"))
510 adcChanged()
511 sequenceExist.set(value= config.get("Main", "sequenceExist"))
512 sequenceChanged()
513 persistentExist.set(value= config.get("Main", "persistentExist"))
514 persistentChanged()
515 addFieldsExist.set(value= config.get("Main", "addFieldsExist"))
516 addFieldsChanged()
517 protocolVar.set(value= config.get("Main", "protocolVar"))
518 protocolChanged()
520 ppmTypeVar.set(value= config.get("Ppm", "ppmTypeVar"))
521 ppmTypeChanged()
522 ppmPinVar.set(value= config.getint("Ppm", "ppmPinVar"))
523 ppmForMin100Var.set(value= config.getint("Ppm", "ppmForMin100Var"))
524 ppmForPlus100Var.set(value= config.getint("Ppm", "ppmForPlus100Var"))
526 imuPinVar.set(value= config.getint("Imu", "imuPinVar"))
527 imuDisplayOffset.set(value= config.get("Imu", "imuDisplayOffset"))
528 imuOffsetXVar.set(value= config.getint("Imu", "imuOffsetXVar"))
529 imuOffsetYVar.set(value= config.getint("Imu", "imuOffsetYVar"))
530 imuOffsetZVar.set(value= config.getint("Imu", "imuOffsetZVar"))
532 GeneratemagCalData.set(value= config.get("Magnet", "GeneratemagCalData"))
533 xMagOffsetVar.set(value= config.getint("Magnet", "xMagOffsetVar"))
534 yMagOffsetVar.set(value= config.getint("Magnet", "yMagOffsetVar"))
535 zMagOffsetVar.set(value= config.getint("Magnet", "zMagOffsetVar"))
536 xxMagCorrectionVar.set(value= config.getfloat("Magnet", "xxMagCorrectionVar"))
537 xyMagCorrectionVar.set(value= config.getfloat("Magnet", "xyMagCorrectionVar"))
538 xzMagCorrectionVar.set(value= config.getfloat("Magnet", "xzMagCorrectionVar"))
539 yxMagCorrectionVar.set(value= config.getfloat("Magnet", "yxMagCorrectionVar"))
540 yyMagCorrectionVar.set(value= config.getfloat("Magnet", "yyMagCorrectionVar"))
541 yzMagCorrectionVar.set(value= config.getfloat("Magnet", "yzMagCorrectionVar"))
542 zxMagCorrectionVar.set(value= config.getfloat("Magnet", "zxMagCorrectionVar"))
543 zyMagCorrectionVar.set(value= config.getfloat("Magnet", "zyMagCorrectionVar"))
544 zzMagCorrectionVar.set(value= config.getfloat("Magnet", "zzMagCorrectionVar"))
546 pushButtPinVar.set(value= config.getint("Memory", "pushButtPinVar"))
548 varioTypeVar.set(value= config.get("Vario", "varioTypeVar"))
549 secondBaroExist.set(value= config.get("Vario", "secondBaroExist"))
550 varioSourceVar.set(value= config.get("Vario", "varioSourceVar"))
551 varioHysteresisVar.set(value= config.getint("Vario", "varioHysteresisVar"))
552 analogVarioExist.set(value= config.get("Vario", "analogVarioExist"))
553 analogVarioChanged()
554 varioAnalogPinVar.set(value= config.get("Vario", "varioAnalogPinVar"))
555 varioAnalogMinVar.set(value= config.getfloat("Vario", "varioAnalogMinVar"))
556 varioAnalogMaxVar.set(value= config.getfloat("Vario", "varioAnalogMaxVar"))
558 airspeedTypeVar.set(value= config.get("Airspeed", "airspeedTypeVar"))
559 airspeedAtSea15CVar.set(value= config.get("Airspeed", "airspeedAtSea15CVar"))
560 airspeedInKmhVar.set(value= config.get("Airspeed", "airspeedInKmhVar"))
561 airspeedResetAtPpmVar.set(value= config.getint("Airspeed", "airspeedResetAtPpmVar"))
562 airspeedCompMinAtPpmVar.set(value= config.getint("Airspeed", "airspeedCompMinAtPpmVar"))
563 airspeedCompMaxAtPpmVar.set(value= config.getint("Airspeed", "airspeedCompMaxAtPpmVar"))
564 airspeedCompMinVar.set(value= config.getint("Airspeed", "airspeedCompMinVar"))
565 airspeedCompMaxVar.set(value= config.getint("Airspeed", "airspeedCompMaxVar"))
567 volt1Exist.set(value= config.get("Voltage", "volt1Exist"))
568 volt2Exist.set(value= config.get("Voltage", "volt2Exist"))
569 volt3Exist.set(value= config.get("Voltage", "volt3Exist"))
570 volt4Exist.set(value= config.get("Voltage", "volt4Exist"))
571 volt5Exist.set(value= config.get("Voltage", "volt5Exist"))
572 volt6Exist.set(value= config.get("Voltage", "volt6Exist"))
573 volt1PinVar.set(value= config.get("Voltage", "volt1PinVar"))
574 volt2PinVar.set(value= config.get("Voltage", "volt2PinVar"))
575 volt3PinVar.set(value= config.get("Voltage", "volt3PinVar"))
576 volt4PinVar.set(value= config.get("Voltage", "volt4PinVar"))
577 volt5PinVar.set(value= config.get("Voltage", "volt5PinVar"))
578 volt6PinVar.set(value= config.get("Voltage", "volt6PinVar"))
579 volt1RgVar.set(value= config.getfloat("Voltage", "volt1RgVar"))
580 volt2RgVar.set(value= config.getfloat("Voltage", "volt2RgVar"))
581 volt3RgVar.set(value= config.getfloat("Voltage", "volt3RgVar"))
582 volt4RgVar.set(value= config.getfloat("Voltage", "volt4RgVar"))
583 volt5RgVar.set(value= config.getfloat("Voltage", "volt5RgVar"))
584 volt6RgVar.set(value= config.getfloat("Voltage", "volt6RgVar"))
585 volt1RvVar.set(value= config.getfloat("Voltage", "volt1RvVar"))
586 volt2RvVar.set(value= config.getfloat("Voltage", "volt2RvVar"))
587 volt3RvVar.set(value= config.getfloat("Voltage", "volt3RvVar"))
588 volt4RvVar.set(value= config.getfloat("Voltage", "volt4RvVar"))
589 volt5RvVar.set(value= config.getfloat("Voltage", "volt5RvVar"))
590 volt6RvVar.set(value= config.getfloat("Voltage", "volt6RvVar"))
591 volt1ScaleVar.set(value= config.getfloat("Voltage", "volt1ScaleVar"))
592 volt2ScaleVar.set(value= config.getfloat("Voltage", "volt2ScaleVar"))
593 volt3ScaleVar.set(value= config.getfloat("Voltage", "volt3ScaleVar"))
594 volt4ScaleVar.set(value= config.getfloat("Voltage", "volt4ScaleVar"))
595 volt5ScaleVar.set(value= config.getfloat("Voltage", "volt5ScaleVar"))
596 volt5ScaleVar.set(value= config.getfloat("Voltage", "volt6ScaleVar"))
597 volt1OffsetVar.set(value= config.getfloat("Voltage", "volt1OffsetVar"))
598 volt2OffsetVar.set(value= config.getfloat("Voltage", "volt2OffsetVar"))
599 volt3OffsetVar.set(value= config.getfloat("Voltage", "volt3OffsetVar"))
600 volt4OffsetVar.set(value= config.getfloat("Voltage", "volt4OffsetVar"))
601 volt5OffsetVar.set(value= config.getfloat("Voltage", "volt5OffsetVar"))
602 volt6OffsetVar.set(value= config.getfloat("Voltage", "volt6OffsetVar"))
603 voltReferenceVar.set(value= config.get("Voltage", "voltReferenceVar"))
604 voltRefValueVar.set(value= config.getfloat("Voltage", "voltRefValueVar"))
605 voltReferenceChanged()
608 currentPinVar.set(value= config.get("Current", "currentPinVar"))
609 currentMvoltAt0Var.set(value= config.getfloat("Current", "currentMvoltAt0Var"))
610 currentMvoltPerAmpVar.set(value= config.getfloat("Current", "currentMvoltPerAmpVar"))
611 currentRgVar.set(value= config.getfloat("Current", "currentRgVar"))
612 currentRcVar.set(value= config.getfloat("Current", "currentRcVar"))
614 flowPulsesmlVar.set(value= config.getint("Flow", "flowPulsesmlVar"))
615 flowTankCapVar.set(value= config.getint("Flow", "flowTankCapVar"))
616 flowL1ValueVar.set(value= config.getint("Flow", "flowL1ValueVar"))
617 flowL1CorrVar.set(value= config.getint("Flow", "flowL1CorrVar"))
618 flowL2ValueVar.set(value= config.getint("Flow", "flowL2ValueVar"))
619 flowL2CorrVar.set(value= config.getint("Flow", "flowL2CorrVar"))
620 flowL3ValueVar.set(value= config.getint("Flow", "flowL3ValueVar"))
621 flowL3CorrVar.set(value= config.getint("Flow", "flowL3CorrVar"))
622 flowL4ValueVar.set(value= config.getint("Flow", "flowL4ValueVar"))
623 flowL4CorrVar.set(value= config.getint("Flow", "flowL4CorrVar"))
624 flowPPMResetVar.set(value= config.getint("Flow", "flowPPMResetVar"))
626 pulsesPerRotationVar.set(value=config.get("Rpm","pulsesPerRotationVar"))
628 Adc0TypeVar.set(value= config.get("Ads", "Adc0TypeVar"))
629 Adc1TypeVar.set(value= config.get("Ads", "Adc1TypeVar"))
630 Adc2TypeVar.set(value= config.get("Ads", "Adc2TypeVar"))
631 Adc3TypeVar.set(value= config.get("Ads", "Adc3TypeVar"))
632 Adc0FsVar.set(value= config.get("Ads", "Adc0FsVar"))
633 Adc1FsVar.set(value= config.get("Ads", "Adc1FsVar"))
634 Adc2FsVar.set(value= config.get("Ads", "Adc2FsVar"))
635 Adc3FsVar.set(value= config.get("Ads", "Adc3FsVar"))
636 Adc0OffVar.set(value= config.getint("Ads", "Adc0OffVar"))
637 Adc1OffVar.set(value= config.getint("Ads", "Adc1OffVar"))
638 Adc2OffVar.set(value= config.getint("Ads", "Adc2OffVar"))
639 Adc3OffVar.set(value= config.getint("Ads", "Adc3OffVar"))
640 Adc0ScVar.set(value= config.getfloat("Ads", "Adc0ScVar"))
641 Adc1ScVar.set(value= config.getfloat("Ads", "Adc1ScVar"))
642 Adc2ScVar.set(value= config.getfloat("Ads", "Adc2ScVar"))
643 Adc3ScVar.set(value= config.getfloat("Ads", "Adc3ScVar"))
644 Adc0CrVar.set(value= config.get("Ads", "Adc0CrVar"))
645 Adc1CrVar.set(value= config.get("Ads", "Adc1CrVar"))
646 Adc2CrVar.set(value= config.get("Ads", "Adc2CrVar"))
647 Adc3CrVar.set(value= config.get("Ads", "Adc3CrVar"))
648 Adc0AvgVar.set(value= config.getint("Ads", "Adc0AvgVar"))
649 Adc1AvgVar.set(value= config.getint("Ads", "Adc1AvgVar"))
650 Adc2AvgVar.set(value= config.getint("Ads", "Adc2AvgVar"))
651 Adc3AvgVar.set(value= config.getint("Ads", "Adc3AvgVar"))
652 AdcCurrVar.set(value= config.get("Ads", "AdcCurrVar"))
653 AdcSpVar.set(value= config.get("Ads", "AdcSpVar"))
655 gpsM10.set(value= config.get("Gps", "gpsM10"))
656 gps3dExist.set(value= config.get("Gps", "gps3dexist"))
657 gpsTimeExist.set(value= config.get("Gps", "gpstimeexist"))
658 gpsRateVar.set(value= config.getint("Gps", "gpsratevar"))
659 fillTest1VarioTemperatureVar.set(value= config.get("AddFields", "fillTest1VarioTemperatureVar"))
660 fillTest2VarioTemperatureVar.set(value= config.get("AddFields", "fillTest2VarioTemperatureVar"))
661 fillTest3VarioTemperatureVar.set(value= config.get("AddFields", "fillTest3VarioTemperatureVar"))
662 fillTest3ExpectedAltitudeVar.set(value= config.get("AddFields", "fillTest3ExpectedAltitudeVar"))
663 fillTest3ExpectedAltitudeChanged()
664 expAltTimeVar.set(value= config.getfloat("AddFields", "expAltTimeVar"))
665 fillTest123LinearAccVar.set(value= config.get("AddFields", "fillTest123LinearAccVar"))
666 fillTest12VspeedAltVar.set(value= config.get("AddFields", "fillTest12VspeedAltVar"))
667 fillTest1DteVar.set(value= config.get("AddFields", "fillTest1DteVar"))
668 fillTest2PpmAirspeedCompVar.set(value= config.get("AddFields", "fillTest2PpmAirspeedCompVar"))
669 fillTest1YawRateVar.set(value= config.get("AddFields", "fillTest1YawRateVar"))
670 fillTest1HeadingVar.set(value= config.get("AddFields", "fillTest1HeadingVar"))
671 fillTest123FlowVar.set(value= config.get("AddFields", "fillTest123FlowVar"))
672 fillTest1GpsNbrSatVar.set(value= config.get("AddFields", "fillTest1GpsNbrSatVar"))
673 fillTest2GpsHdopVar.set(value= config.get("AddFields", "fillTest2GpsHdopVar"))
675 frskyVfasVar.set(value= config.get("Frsky", "frskyVfasVar"))
676 frskyFuelVar.set(value= config.get("Frsky", "frskyFuelVar"))
677 frskyA3Var.set(value= config.get("Frsky", "frskyA3Var"))
678 frskyA4Var.set(value= config.get("Frsky", "frskyA4Var"))
679 frskyAccxVar.set(value= config.get("Frsky", "frskyAccxVar"))
680 frskyAccyVar.set(value= config.get("Frsky", "frskyAccyVar"))
681 frskyAcczVar.set(value= config.get("Frsky", "frskyAcczVar"))
682 frskyT1Var.set(value= config.get("Frsky", "frskyT1Var"))
683 frskyT2Var.set(value= config.get("Frsky", "frskyT2Var"))
685 multiplexLine1Var.set(value= config.get("Multiplex", "multiplexLine1Var"))
686 multiplexLine2Var.set(value= config.get("Multiplex", "multiplexLine2Var"))
687 multiplexLine3Var.set(value= config.get("Multiplex", "multiplexLine3Var"))
688 multiplexLine4Var.set(value= config.get("Multiplex", "multiplexLine4Var"))
689 multiplexLine5Var.set(value= config.get("Multiplex", "multiplexLine5Var"))
690 multiplexLine6Var.set(value= config.get("Multiplex", "multiplexLine6Var"))
691 multiplexLine7Var.set(value= config.get("Multiplex", "multiplexLine7Var"))
692 multiplexLine8Var.set(value= config.get("Multiplex", "multiplexLine8Var"))
693 multiplexLine9Var.set(value= config.get("Multiplex", "multiplexLine9Var"))
695 hottBattery1SourceVar.set(value= config.get("Hott", "hottBattery1SourceVar"))
696 hottBattery2SourceVar.set(value= config.get("Hott", "hottBattery2SourceVar"))
697 hottCellUndervoltageVar.set(value= config.getint("Hott", "hottCellUndervoltageVar"))
698 hottMainBatterySourceVar.set(value= config.get("Hott", "hottMainBatterySourceVar"))
699 hottT1SourceVar.set(value= config.get("Hott", "hottT1SourceVar"))
700 hottT2SourceVar.set(value= config.get("Hott", "hottT2SourceVar"))
702 jetiVoltageSourceVar.set(value= config.get("Jeti", "jetiVoltageSourceVar"))
703 jetiTemperatureSourceVar.set(value= config.get("Jeti", "jetiTemperatureSourceVar"))
705 def saveConfig():
706 config.set("Main", "ppmExist", ppmExist.get())
707 config.set("Main", "varioExist", varioExist.get())
708 config.set("Main", "voltageExist", voltageExist.get())
709 config.set("Main", "currentExist", currentExist.get())
710 config.set("Main", "gpsExist", gpsExist.get())
711 config.set("Main", "airspeedExist", airspeedExist.get())
712 config.set("Main", "rpmExist", rpmExist.get())
713 config.set("Main", "imuExist", imuExist.get())
714 config.set("Main", "magnetExist", magnetExist.get())
715 config.set("Main", "flowExist", flowExist.get())
716 config.set("Main", "adcExist", adcExist.get())
717 config.set("Main", "sequenceExist", sequenceExist.get())
718 config.set("Main", "persistentExist", persistentExist.get())
720 config.set("Main", "addFieldsExist", addFieldsExist.get())
721 config.set("Main", "protocolVar", protocolVar.get())
723 config.set("Ppm", "ppmTypeVar", ppmTypeVar.get())
724 config.set("Ppm", "ppmPinVar", str(ppmPinVar.get()))
725 config.set("Ppm", "ppmForMin100Var", str(ppmForMin100Var.get()))
726 config.set("Ppm", "ppmForPlus100Var", str(ppmForPlus100Var.get()))
728 config.set("Imu", "imuPinVar", str(imuPinVar.get()))
729 config.set("Imu", "imuDisplayOffset", imuDisplayOffset.get())
730 config.set("Imu", "imuOffsetXVar", str(imuOffsetXVar.get()))
731 config.set("Imu", "imuOffsetYVar", str(imuOffsetYVar.get()))
732 config.set("Imu", "imuOffsetZVar", str(imuOffsetZVar.get()))
734 config.set("Magnet", "GeneratemagCalData", GeneratemagCalData.get())
735 config.set("Magnet", "xMagOffsetVar", str(xMagOffsetVar.get()))
736 config.set("Magnet", "yMagOffsetVar", str(yMagOffsetVar.get()))
737 config.set("Magnet", "zMagOffsetVar", str(zMagOffsetVar.get()))
738 config.set("Magnet", "xxMagCorrectionVar", str(xxMagCorrectionVar.get()))
739 config.set("Magnet", "xyMagCorrectionVar", str(xyMagCorrectionVar.get()))
740 config.set("Magnet", "xzMagCorrectionVar", str(xzMagCorrectionVar.get()))
741 config.set("Magnet", "yxMagCorrectionVar", str(xxMagCorrectionVar.get()))
742 config.set("Magnet", "yyMagCorrectionVar", str(yyMagCorrectionVar.get()))
743 config.set("Magnet", "yzMagCorrectionVar", str(yzMagCorrectionVar.get()))
744 config.set("Magnet", "zxMagCorrectionVar", str(zxMagCorrectionVar.get()))
745 config.set("Magnet", "zyMagCorrectionVar", str(zyMagCorrectionVar.get()))
746 config.set("Magnet", "zzMagCorrectionVar", str(zzMagCorrectionVar.get()))
748 config.set("Memory", "pushButtPinVar", str(pushButtPinVar.get()))
750 config.set("Vario", "varioTypeVar", varioTypeVar.get())
751 config.set("Vario", "secondBaroExist", secondBaroExist.get())
752 config.set("Vario", "varioSourceVar", varioSourceVar.get())
753 config.set("Vario", "varioHysteresisVar", str(varioHysteresisVar.get()))
754 config.set("Vario", "analogVarioExist", analogVarioExist.get())
755 config.set("Vario", "varioAnalogPinVar", varioAnalogPinVar.get())
756 config.set("Vario", "varioAnalogMinVar", str(varioAnalogMinVar.get()))
757 config.set("Vario", "varioAnalogMaxVar", str(varioAnalogMaxVar.get()))
759 config.set("Airspeed", "airspeedTypeVar", airspeedTypeVar.get())
760 config.set("Airspeed", "airspeedAtSea15CVar", airspeedAtSea15CVar.get())
761 config.set("Airspeed", "airspeedInKmhVar", airspeedInKmhVar.get())
762 config.set("Airspeed", "airspeedResetAtPpmVar", str(airspeedResetAtPpmVar.get()))
763 config.set("Airspeed", "airspeedCompMinAtPpmVar", str(airspeedCompMinAtPpmVar.get()))
764 config.set("Airspeed", "airspeedCompMaxAtPpmVar", str(airspeedCompMaxAtPpmVar.get()))
765 config.set("Airspeed", "airspeedCompMinVar", str(airspeedCompMinVar.get()))
766 config.set("Airspeed", "airspeedCompMaxVar", str(airspeedCompMaxVar.get()))
768 config.set("Voltage", "volt1Exist", volt1Exist.get())
769 config.set("Voltage", "volt2Exist", volt2Exist.get())
770 config.set("Voltage", "volt3Exist", volt3Exist.get())
771 config.set("Voltage", "volt4Exist", volt4Exist.get())
772 config.set("Voltage", "volt5Exist", volt5Exist.get())
773 config.set("Voltage", "volt6Exist", volt6Exist.get())
774 config.set("Voltage", "volt1PinVar", volt1PinVar.get())
775 config.set("Voltage", "volt2PinVar", volt2PinVar.get())
776 config.set("Voltage", "volt3PinVar", volt3PinVar.get())
777 config.set("Voltage", "volt4PinVar", volt4PinVar.get())
778 config.set("Voltage", "volt5PinVar", volt5PinVar.get())
779 config.set("Voltage", "volt6PinVar", volt6PinVar.get())
780 config.set("Voltage", "volt1RgVar", str(volt1RgVar.get()))
781 config.set("Voltage", "volt2RgVar", str(volt2RgVar.get()))
782 config.set("Voltage", "volt3RgVar", str(volt3RgVar.get()))
783 config.set("Voltage", "volt4RgVar", str(volt4RgVar.get()))
784 config.set("Voltage", "volt5RgVar", str(volt5RgVar.get()))
785 config.set("Voltage", "volt6RgVar", str(volt6RgVar.get()))
786 config.set("Voltage", "volt1RvVar", str(volt1RvVar.get()))
787 config.set("Voltage", "volt2RvVar", str(volt2RvVar.get()))
788 config.set("Voltage", "volt3RvVar", str(volt3RvVar.get()))
789 config.set("Voltage", "volt4RvVar", str(volt4RvVar.get()))
790 config.set("Voltage", "volt5RvVar", str(volt5RvVar.get()))
791 config.set("Voltage", "volt6RvVar", str(volt6RvVar.get()))
792 config.set("Voltage", "volt1ScaleVar", str(volt1ScaleVar.get()))
793 config.set("Voltage", "volt2ScaleVar", str(volt2ScaleVar.get()))
794 config.set("Voltage", "volt3ScaleVar", str(volt3ScaleVar.get()))
795 config.set("Voltage", "volt4ScaleVar", str(volt4ScaleVar.get()))
796 config.set("Voltage", "volt5ScaleVar", str(volt5ScaleVar.get()))
797 config.set("Voltage", "volt6ScaleVar", str(volt6ScaleVar.get()))
798 config.set("Voltage", "volt1OffsetVar", str(volt1OffsetVar.get()))
799 config.set("Voltage", "volt2OffsetVar", str(volt2OffsetVar.get()))
800 config.set("Voltage", "volt3OffsetVar", str(volt3OffsetVar.get()))
801 config.set("Voltage", "volt4OffsetVar", str(volt4OffsetVar.get()))
802 config.set("Voltage", "volt5OffsetVar", str(volt5OffsetVar.get()))
803 config.set("Voltage", "volt6OffsetVar", str(volt6OffsetVar.get()))
804 config.set("Voltage", "voltReferenceVar", voltReferenceVar.get())
805 config.set("Voltage", "voltRefValueVar", str(voltRefValueVar.get()))
807 config.set("Current", "currentPinVar", currentPinVar.get())
808 config.set("Current", "currentMvoltAt0Var", str(currentMvoltAt0Var.get()))
809 config.set("Current", "currentMvoltPerAmpVar", str(currentMvoltPerAmpVar.get()))
810 config.set("Current", "currentRgVar", str(currentRgVar.get()))
811 config.set("Current", "currentRcVar", str(currentRcVar.get()))
813 config.set("Flow", "flowPulsesmlVar", str(flowPulsesmlVar.get()))
814 config.set("Flow", "flowTankCapVar", str(flowTankCapVar.get()))
815 config.set("Flow", "flowL1ValueVar", str(flowL1ValueVar.get()))
816 config.set("Flow", "flowL1CorrVar", str(flowL1CorrVar.get()))
817 config.set("Flow", "flowL2ValueVar", str(flowL2ValueVar.get()))
818 config.set("Flow", "flowL2CorrVar", str(flowL2CorrVar.get()))
819 config.set("Flow", "flowL3ValueVar", str(flowL3ValueVar.get()))
820 config.set("Flow", "flowL3CorrVar", str(flowL3CorrVar.get()))
821 config.set("Flow", "flowL4ValueVar", str(flowL4ValueVar.get()))
822 config.set("Flow", "flowL4CorrVar", str(flowL4CorrVar.get()))
823 config.set("Flow", "flowPPMResetVar", str(flowPPMResetVar.get()))
825 config.set("Rpm", "pulsesPerRotationVar", str(pulsesPerRotationVar.get()))
827 config.set("Ads", "Adc0TypeVar", Adc0TypeVar.get())
828 config.set("Ads", "Adc1TypeVar", Adc1TypeVar.get())
829 config.set("Ads", "Adc2TypeVar", Adc2TypeVar.get())
830 config.set("Ads", "Adc3TypeVar", Adc3TypeVar.get())
831 config.set("Ads", "Adc0FsVar", Adc0FsVar.get())
832 config.set("Ads", "Adc1FsVar", Adc1FsVar.get())
833 config.set("Ads", "Adc2FsVar", Adc2FsVar.get())
834 config.set("Ads", "Adc3FsVar", Adc3FsVar.get())
835 config.set("Ads", "Adc0OffVar", str(Adc0OffVar.get()))
836 config.set("Ads", "Adc1OffVar", str(Adc1OffVar.get()))
837 config.set("Ads", "Adc2OffVar", str(Adc2OffVar.get()))
838 config.set("Ads", "Adc3OffVar", str(Adc3OffVar.get()))
839 config.set("Ads", "Adc0ScVar", str(Adc0ScVar.get()))
840 config.set("Ads", "Adc1ScVar", str(Adc1ScVar.get()))
841 config.set("Ads", "Adc2ScVar", str(Adc2ScVar.get()))
842 config.set("Ads", "Adc3ScVar", str(Adc3ScVar.get()))
843 config.set("Ads", "Adc0CrVar", Adc0CrVar.get())
844 config.set("Ads", "Adc1CrVar", Adc1CrVar.get())
845 config.set("Ads", "Adc2CrVar", Adc2CrVar.get())
846 config.set("Ads", "Adc3CrVar", Adc3CrVar.get())
847 config.set("Ads", "Adc0AvgVar", str(Adc0AvgVar.get()))
848 config.set("Ads", "Adc1AvgVar", str(Adc1AvgVar.get()))
849 config.set("Ads", "Adc2AvgVar", str(Adc2AvgVar.get()))
850 config.set("Ads", "Adc3AvgVar", str(Adc3AvgVar.get()))
851 config.set("Ads", "AdcCurrVar", AdcCurrVar.get())
852 config.set("Ads", "AdcSpVar", AdcSpVar.get())
854 config.set("Gps", "gpsM10", gpsM10.get())
855 config.set("Gps", "gps3dExist", gps3dExist.get())
856 config.set("Gps", "gpsTimeExist", gpsTimeExist.get())
857 config.set("Gps", "gpsRateVar", gpsRateVar.get())
859 config.set("AddFields", "fillTest1VarioTemperatureVar", fillTest1VarioTemperatureVar.get())
860 config.set("AddFields", "fillTest2VarioTemperatureVar", fillTest2VarioTemperatureVar.get())
861 config.set("AddFields", "fillTest3VarioTemperatureVar", fillTest3VarioTemperatureVar.get())
862 config.set("AddFields", "fillTest3ExpectedAltitudeVar", fillTest3ExpectedAltitudeVar.get())
863 config.set("AddFields", "expAltTimeVar", str(expAltTimeVar.get()))
864 config.set("AddFields", "fillTest123LinearAccVar", fillTest123LinearAccVar.get())
865 config.set("AddFields", "fillTest12VspeedAltVar", fillTest12VspeedAltVar.get())
866 config.set("AddFields", "fillTest1DteVar", fillTest1DteVar.get())
867 config.set("AddFields", "fillTest2PpmAirspeedCompVar", fillTest2PpmAirspeedCompVar.get())
868 config.set("AddFields", "fillTest1YawRateVar", fillTest1YawRateVar.get())
869 config.set("AddFields", "fillTest1HeadingVar", fillTest1HeadingVar.get())
870 config.set("AddFields", "fillTest123FlowVar", fillTest123FlowVar.get())
871 config.set("AddFields", "fillTest1GpsNbrSatVar", fillTest1GpsNbrSatVar.get())
872 config.set("AddFields", "fillTest2GpsHdopVar", fillTest2GpsHdopVar.get())
874 config.set("Frsky", "frskyVfasVar", frskyVfasVar.get())
875 config.set("Frsky", "frskyFuelVar", frskyFuelVar.get())
876 config.set("Frsky", "frskyA3Var", frskyA3Var.get())
877 config.set("Frsky", "frskyA4Var", frskyA4Var.get())
878 config.set("Frsky", "frskyAccxVar", frskyAccxVar.get())
879 config.set("Frsky", "frskyAccyVar", frskyAccyVar.get())
880 config.set("Frsky", "frskyAcczVar", frskyAcczVar.get())
881 config.set("Frsky", "frskyT1Var", frskyT1Var.get())
882 config.set("Frsky", "frskyT2Var", frskyT2Var.get())
884 config.set("Multiplex", "multiplexLine1Var", multiplexLine1Var.get())
885 config.set("Multiplex", "multiplexLine2Var", multiplexLine2Var.get())
886 config.set("Multiplex", "multiplexLine3Var", multiplexLine3Var.get())
887 config.set("Multiplex", "multiplexLine4Var", multiplexLine4Var.get())
888 config.set("Multiplex", "multiplexLine5Var", multiplexLine5Var.get())
889 config.set("Multiplex", "multiplexLine6Var", multiplexLine6Var.get())
890 config.set("Multiplex", "multiplexLine7Var", multiplexLine7Var.get())
891 config.set("Multiplex", "multiplexLine8Var", multiplexLine8Var.get())
892 config.set("Multiplex", "multiplexLine9Var", multiplexLine9Var.get())
894 config.set("Hott", "hottBattery1SourceVar", hottBattery1SourceVar.get())
895 config.set("Hott", "hottBattery2SourceVar", hottBattery2SourceVar.get())
896 config.set("Hott", "hottCellUndervoltageVar", str(hottCellUndervoltageVar.get()))
897 config.set("Hott", "hottMainBatterySourceVar", hottMainBatterySourceVar.get())
898 config.set("Hott", "hottT1SourceVar", hottT1SourceVar.get())
899 config.set("Hott", "hottT2SourceVar", hottT2SourceVar.get())
901 config.set("Jeti", "jetiVoltageSourceVar", jetiVoltageSourceVar.get())
902 config.set("Jeti", "jetiTemperatureSourceVar", jetiTemperatureSourceVar.get())
904 configSaveFileName = filedialog.asksaveasfilename(title="Save as...", defaultextension="*.ini",\
905 filetypes=[("Ini files","*.ini"),("All files", "*")], initialfile=configUploadFileName)
906 print(configSaveFileName)
907 config.write(open(configSaveFileName ,'w'))
908 #configUploadFileName = configSaveFileName
909 #config.write(open('config.ini','w'))
911 def protocolChanged(*arg):
912 #print(protocolVar.get() )
913 nb.tab(16, state="hidden")
914 nb.tab(17, state="hidden")
915 nb.tab(18, state="hidden")
916 nb.tab(19, state="hidden")
917 if protocolVar.get() == "FRSKY_SPORT" or protocolVar.get() == "FRSKY_HUB" or protocolVar.get() == "FRSKY_SPORT_HUB" :
918 nb.tab(16, state="normal")
919 elif protocolVar.get() == "JETI":
920 nb.tab(17, state="normal")
921 elif protocolVar.get() == "HOTT":
922 nb.tab(18, state="normal")
923 elif protocolVar.get() == "MULTIPLEX":
924 nb.tab(19, state="normal")
926 def ppmChanged():
927 if ppmExist.get() == 'On':
928 nb.tab(1, state="normal")
929 else:
930 nb.tab(1, state="hidden")
931 def ppmTypeChanged(*arg):
932 if ppmTypeVar.get() == 'Rx chanel':
933 fPpmType.grid(row=8)
934 else:
935 fPpmType.grid_remove()
936 def varioChanged():
937 if varioExist.get() == 'On':
938 nb.tab(2, state="normal")
939 else:
940 nb.tab(2, state="hidden")
941 def voltageChanged():
942 if voltageExist.get() == 'On':
943 nb.tab(3, state="normal")
944 else:
945 nb.tab(3, state="hidden")
946 def currentChanged():
947 if currentExist.get() == 'On':
948 nb.tab(4, state="normal")
949 else:
950 nb.tab(4, state="hidden")
951 def gpsChanged():
952 if gpsExist.get() == 'On':
953 nb.tab(5, state="normal")
954 else:
955 nb.tab(5, state="hidden")
956 def airspeedChanged():
957 if airspeedExist.get() == 'On':
958 nb.tab(6, state="normal")
959 else:
960 nb.tab(6, state="hidden")
961 def rpmChanged():
962 if rpmExist.get() == 'On':
963 nb.tab(7, state="normal")
964 else:
965 nb.tab(7, state="hidden")
966 def imuChanged():
967 if imuExist.get() == 'On':
968 nb.tab(8, state="normal")
969 else:
970 nb.tab(8, state="hidden")
971 def magnetChanged():
972 if magnetExist.get() == 'On':
973 nb.tab(9, state="normal")
974 else:
975 nb.tab(9, state="hidden")
976 def flowChanged():
977 if flowExist.get() == 'On':
978 nb.tab(10, state="normal")
979 else:
980 nb.tab(10, state="hidden")
981 def adcChanged():
982 if adcExist.get() == 'On':
983 nb.tab(11, state="normal")
984 else:
985 nb.tab(11, state="hidden")
986 def locatorChanged():
987 if locatorExist.get() == 'On':
988 nb.tab(12, state="normal")
989 else:
990 nb.tab(12, state="hidden")
991 def sequenceChanged():
992 if sequenceExist.get() == 'On':
993 nb.tab(13, state="normal")
994 else:
995 nb.tab(13, state="hidden")
996 def persistentChanged():
997 if persistentExist.get() == 'On':
998 nb.tab(14, state="normal")
999 else:
1000 nb.tab(14, state="hidden")
1001 def addFieldsChanged():
1002 if addFieldsExist.get() == 'On':
1003 nb.tab(15, state="normal")
1004 else:
1005 nb.tab(15, state="hidden")
1007 def fillTest3ExpectedAltitudeChanged():
1008 if fillTest3ExpectedAltitudeVar.get() == 'On':
1009 fFillTest3ExpectedAltitude.grid(row=4)
1010 else:
1011 fFillTest3ExpectedAltitude.grid_remove()
1012 def analogVarioChanged():
1013 if analogVarioExist.get() == 'On':
1014 fAnalogVario.grid(row=8)
1015 else:
1016 fAnalogVario.grid_remove()
1019 root = Tk()
1020 root.title("openXsensor configurator V1.0.4")
1021 nb = ttk.Notebook(root)
1022 nb.enable_traversal()
1023 fMain = ttk.Frame(nb)
1024 fPpm = ttk.Frame(nb) # page 1
1025 fVario = ttk.Frame(nb) # page 2
1026 fVoltage = ttk.Frame(nb) # page 3
1027 fCurrent = ttk.Frame(nb) # page 4
1028 fGps = ttk.Frame(nb) # page 5
1029 fAirspeed = ttk.Frame(nb) # page 6
1030 fRpm = ttk.Frame(nb) # page 7
1031 fImu = ttk.Frame(nb) # page 8
1032 fMagnet = ttk.Frame(nb) # page 9
1033 fFlow = ttk.Frame(nb) # page 10
1034 fAdc = ttk.Frame(nb) # page 11
1035 fLocator = ttk.Frame(nb) # page 12
1036 fSequence = ttk.Frame(nb) # page 13
1037 fMemory = ttk.Frame(nb) # page 14
1038 fAddFields = ttk.Frame(nb) # page 15
1039 fFrsky = ttk.Frame(nb) # page 16
1040 fJeti = ttk.Frame(nb) # page 17
1041 fHott = ttk.Frame(nb) # page 18
1042 fMultiplex = ttk.Frame(nb) # page 19
1044 ppmExist = StringVar(value='Off')
1045 varioExist = StringVar(value='Off')
1046 voltageExist = StringVar(value='Off')
1047 currentExist = StringVar(value='Off')
1048 gpsExist = StringVar(value='Off')
1049 airspeedExist = StringVar(value='Off')
1050 rpmExist = StringVar(value='Off')
1051 imuExist = StringVar(value='Off')
1052 magnetExist = StringVar(value='Off')
1053 flowExist = StringVar(value='Off')
1054 locatorExist = StringVar(value='Off')
1055 persistentExist = StringVar(value='Off')
1056 adcExist = StringVar(value='Off')
1057 sequenceExist = StringVar(value='Off')
1058 addFieldsExist = StringVar(value='Off')
1060 fPpmType = ttk.Frame(fPpm)
1061 ppmTypeVar = StringVar(value='Rx chanel')
1062 ppmPinVar = IntVar(value = 2)
1063 ppmForMin100Var = IntVar(value = 1000)
1064 ppmForPlus100Var = IntVar(value = 2000)
1066 imuPinVar = IntVar(value = 3)
1067 imuDisplayOffset = StringVar(value='Off')
1068 imuOffsetXVar = IntVar(value=0)
1069 imuOffsetYVar = IntVar(value=0)
1070 imuOffsetZVar = IntVar(value=0)
1072 flowPulsesmlVar = IntVar(value = 10)
1073 flowTankCapVar = IntVar(value = 1000)
1074 flowL1ValueVar = IntVar(value = 0)
1075 flowL1CorrVar = IntVar(value = 0)
1076 flowL2ValueVar = IntVar(value = 0)
1077 flowL2CorrVar = IntVar(value = 0)
1078 flowL3ValueVar = IntVar(value = 0)
1079 flowL3CorrVar = IntVar(value = 0)
1080 flowL4ValueVar = IntVar(value = 0)
1081 flowL4CorrVar = IntVar(value = 0)
1082 flowPPMResetVar = IntVar(value = 95)
1084 pushButtPinVar = IntVar(value = 10)
1086 GeneratemagCalData = StringVar(value='Off')
1087 xMagOffsetVar= IntVar(value=0)
1088 yMagOffsetVar= IntVar(value=0)
1089 zMagOffsetVar= IntVar(value=0)
1090 xxMagCorrectionVar = DoubleVar(value=0)
1091 xyMagCorrectionVar = DoubleVar(value=0)
1092 xzMagCorrectionVar = DoubleVar(value=0)
1093 yxMagCorrectionVar = DoubleVar(value=0)
1094 yyMagCorrectionVar = DoubleVar(value=0)
1095 yzMagCorrectionVar = DoubleVar(value=0)
1096 zxMagCorrectionVar = DoubleVar(value=0)
1097 zyMagCorrectionVar = DoubleVar(value=0)
1098 zzMagCorrectionVar = DoubleVar(value=0)
1100 varioTypeVar = StringVar(value='MS5611')
1102 secondBaroExist = StringVar(value='Off')
1103 varioSourceVar = StringVar(value='FIRST_BARO')
1104 varioHysteresisVar = IntVar(value=5)
1107 fAnalogVario = ttk.Frame(fVario)
1108 analogVarioExist = StringVar(value='Off')
1109 varioAnalogPinVar = StringVar(value='3')
1110 varioAnalogMinVar = DoubleVar(value=-3)
1111 varioAnalogMaxVar = DoubleVar(value=3)
1113 airspeedTypeVar = StringVar(value='MS4525')
1114 airspeedAtSea15CVar = StringVar(value='Off')
1115 airspeedInKmhVar = StringVar(value='Off')
1116 airspeedResetAtPpmVar = IntVar(value=100)
1117 airspeedCompMinAtPpmVar = IntVar(value=60)
1118 airspeedCompMaxAtPpmVar = IntVar(value=90)
1119 airspeedCompMinVar = IntVar(value=80)
1120 airspeedCompMaxVar = IntVar(value=140)
1122 Adc0TypeVar= StringVar(value='ADS_OFF')
1123 Adc1TypeVar= StringVar(value='ADS_OFF')
1124 Adc2TypeVar= StringVar(value='ADS_OFF')
1125 Adc3TypeVar= StringVar(value='ADS_OFF')
1126 Adc0FsVar= StringVar(value='MV6144')
1127 Adc1FsVar= StringVar(value='MV6144')
1128 Adc2FsVar= StringVar(value='MV6144')
1129 Adc3FsVar= StringVar(value='MV6144')
1130 Adc0OffVar = IntVar(value=0)
1131 Adc1OffVar = IntVar(value=0)
1132 Adc2OffVar = IntVar(value=0)
1133 Adc3OffVar = IntVar(value=0)
1134 Adc0ScVar = DoubleVar(value=1)
1135 Adc1ScVar = DoubleVar(value=1)
1136 Adc2ScVar = DoubleVar(value=1)
1137 Adc3ScVar = DoubleVar(value=1)
1138 Adc0CrVar= StringVar(value='MS2')
1139 Adc1CrVar= StringVar(value='MS2')
1140 Adc2CrVar= StringVar(value='MS2')
1141 Adc3CrVar= StringVar(value='MS2')
1142 Adc0AvgVar = IntVar(value=10)
1143 Adc1AvgVar = IntVar(value=10)
1144 Adc2AvgVar = IntVar(value=10)
1145 Adc3AvgVar = IntVar(value=10)
1146 AdcCurrVar = StringVar(value='NO')
1147 AdcSpVar = StringVar(value='NO')
1149 volt1Exist = StringVar(value='Off')
1150 volt2Exist = StringVar(value='Off')
1151 volt3Exist = StringVar(value='Off')
1152 volt4Exist = StringVar(value='Off')
1153 volt5Exist = StringVar(value='Off')
1154 volt6Exist = StringVar(value='Off')
1155 volt1PinVar = StringVar(value='0')
1156 volt2PinVar = StringVar(value='1')
1157 volt3PinVar = StringVar(value='2')
1158 volt4PinVar = StringVar(value='3')
1159 volt5PinVar = StringVar(value='6')
1160 volt6PinVar = StringVar(value='7')
1162 volt1RgVar = DoubleVar(value='0.0')
1163 volt2RgVar = DoubleVar(value='0.0')
1164 volt3RgVar = DoubleVar(value='0.0')
1165 volt4RgVar = DoubleVar(value='0.0')
1166 volt5RgVar = DoubleVar(value='0.0')
1167 volt6RgVar = DoubleVar(value='0.0')
1169 volt1RvVar = DoubleVar(value='0.0')
1170 volt2RvVar = DoubleVar(value='0.0')
1171 volt3RvVar = DoubleVar(value='0.0')
1172 volt4RvVar = DoubleVar(value='0.0')
1173 volt5RvVar = DoubleVar(value='0.0')
1174 volt6RvVar = DoubleVar(value='0.0')
1176 volt1ScaleVar = DoubleVar(value='1.0')
1177 volt2ScaleVar = DoubleVar(value='1.0')
1178 volt3ScaleVar = DoubleVar(value='1.0')
1179 volt4ScaleVar = DoubleVar(value='1.0')
1180 volt5ScaleVar = DoubleVar(value='1.0')
1181 volt6ScaleVar = DoubleVar(value='1.0')
1183 volt1OffsetVar = DoubleVar(value='0.0')
1184 volt2OffsetVar = DoubleVar(value='0.0')
1185 volt3OffsetVar = DoubleVar(value='0.0')
1186 volt4OffsetVar = DoubleVar(value='0.0')
1187 volt5OffsetVar = DoubleVar(value='0.0')
1188 volt6OffsetVar = DoubleVar(value='0.0')
1190 voltNumberOfCellsVar = StringVar(value='0')
1191 voltReferenceVar = StringVar(value='Internal')
1192 voltRefValueVar = IntVar(value='5000')
1194 currentPinVar = StringVar(value='0')
1195 currentMvoltAt0Var = DoubleVar(value='0.0')
1196 currentMvoltPerAmpVar = DoubleVar(value='0.0')
1197 currentRgVar = DoubleVar(value='0.0')
1198 currentRcVar = DoubleVar(value='0.0')
1200 pulsesPerRotationVar = IntVar(value=2)
1202 pushButtonPin=StringVar(value='10')
1204 gpsM10 = StringVar(value='Off')
1205 gps3dExist = StringVar(value='Off')
1206 gpsTimeExist = StringVar(value='Off')
1207 gpsRateVar = StringVar(value='5')
1209 SeqUnitVar = IntVar(value='1')
1210 SeqMinVoltVar = IntVar(value='0')
1211 SeqMinCellVar = IntVar(value='0')
1212 SeqOut1Var = StringVar(value='0')
1213 SeqOut2Var = StringVar(value='0')
1214 SeqOut3Var = StringVar(value='0')
1215 SeqOut4Var = StringVar(value='0')
1216 SeqOut5Var = StringVar(value='0')
1217 SeqOut6Var = StringVar(value='0')
1218 SeqB5Var = []
1219 SeqB4Var = []
1220 SeqB3Var = []
1221 SeqB2Var = []
1222 SeqB1Var = []
1223 SeqB0Var = []
1224 SeqTVar = []
1226 for x in range(0,100):
1227 SeqB0Var.append(IntVar(value='0'))
1228 SeqB1Var.append(IntVar(value='0'))
1229 SeqB2Var.append(IntVar(value='0'))
1230 SeqB3Var.append(IntVar(value='0'))
1231 SeqB4Var.append(IntVar(value='0'))
1232 SeqB5Var.append(IntVar(value='0'))
1233 SeqTVar.append(StringVar(value=''))
1235 fFillTest3ExpectedAltitude = ttk.Frame(fAddFields)
1236 fillTest3ExpectedAltitudeVar = StringVar(value='Off')
1237 expAltTimeVar = DoubleVar(value='1.5')
1238 fillTest1VarioTemperatureVar = StringVar(value='Off')
1239 fillTest2VarioTemperatureVar = StringVar(value='Off')
1240 fillTest3VarioTemperatureVar = StringVar(value='Off')
1241 fillTest123LinearAccVar = StringVar(value='Off')
1242 fillTest12VspeedAltVar = StringVar(value='Off')
1243 fillTest1DteVar = StringVar(value='Off')
1244 fillTest2PpmAirspeedCompVar = StringVar(value='Off')
1245 fillTest1YawRateVar = StringVar(value='Off')
1246 fillTest1HeadingVar = StringVar(value='Off')
1247 fillTest123FlowVar = StringVar(value='Off')
1248 fillTest1GpsNbrSatVar = StringVar(value='Off')
1249 fillTest2GpsHdopVar = StringVar(value='Off')
1251 protocolVar = StringVar(value='FRSKY_SPORT')
1252 pinToRxVar = StringVar(value='4')
1254 frskyVfasVar= StringVar(value='Not sent')
1255 frskyFuelVar= StringVar(value='Not sent')
1256 frskyA3Var= StringVar(value='Not sent')
1257 frskyA4Var= StringVar(value='Not sent')
1258 frskyAccxVar= StringVar(value='Not sent')
1259 frskyAccyVar= StringVar(value='Not sent')
1260 frskyAcczVar= StringVar(value='Not sent')
1261 frskyT1Var= StringVar(value='Not sent')
1262 frskyT2Var= StringVar(value='Not sent')
1264 multiplexLine1Var = StringVar(value='Not sent')
1265 multiplexLine2Var = StringVar(value='Not sent')
1266 multiplexLine3Var = StringVar(value='Not sent')
1267 multiplexLine4Var = StringVar(value='Not sent')
1268 multiplexLine5Var = StringVar(value='Not sent')
1269 multiplexLine6Var = StringVar(value='Not sent')
1270 multiplexLine7Var = StringVar(value='Not sent')
1271 multiplexLine8Var = StringVar(value='Not sent')
1272 multiplexLine9Var = StringVar(value='Not sent')
1274 hottCellUndervoltageVar = IntVar(value=3300)
1275 hottBattery1SourceVar = StringVar(value='Not sent')
1276 hottBattery2SourceVar = StringVar(value='Not sent')
1277 hottMainBatterySourceVar = StringVar(value='Not sent')
1278 hottT1SourceVar = StringVar(value='Not sent')
1279 hottT2SourceVar = StringVar(value='Not sent')
1281 jetiVoltageSourceVar = StringVar(value='Not sent')
1282 jetiTemperatureSourceVar = StringVar(value='Not sent')